package com.dkts.oil.router;

public enum TransportRoute {
    YK_TO_ZY("YK_TO_ZY", "yk到zy站运输路线规划"),
    ZY_TO_CBK("ZY_TO_CBK", "zy站到cbk运输路线规划"),
    CBK_TO_XHK("CBK_TO_XHK", "cbk到xhk运输路线规划"),
    XHK_TO_WCGYZX("XHK_TO_WCGYZX", "xhk到wcgyzx运输路线规划"),
    LYC_TO_ZY("LYC_TO_ZY", "lyc到zy站运输路线规划"),
    YLCC("YLCC", "ylcc运输规划"),
    KQ_ROUTE("KQ_ROUTE", "kq路由规划"),
    KQ_LAYOUT("KQ_LAYOUT", "kq内部布局与路由规划");

    private final String key;
    private final String name;

    // 构造方法
    TransportRoute(String key, String name) {
        this.key = key;
        this.name = name;
    }

    // Getter 方法
    public String getKey() {
        return key;
    }

    public String getName() {
        return name;
    }

    // 根据 key 查找枚举
    public static TransportRoute fromKey(String key) {
        for (TransportRoute route : TransportRoute.values()) {
            if (route.getKey().equals(key)) {
                return route;
            }
        }
        throw new IllegalArgumentException("无效的路线key: " + key);
    }
}
